'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _Popup = require('rmc-picker/lib/Popup');

var _Popup2 = _interopRequireDefault(_Popup);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var __assign = undefined && undefined.__assign || Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) {
            if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
    }
    return t;
};

var PopupCascader = _react2["default"].createClass({
    displayName: 'PopupCascader',
    getDefaultProps: function getDefaultProps() {
        return {
            pickerValueProp: 'value',
            pickerValueChangeProp: 'onChange'
        };
    },
    onOk: function onOk(v) {
        var _props = this.props,
            onChange = _props.onChange,
            onOk = _props.onOk;

        if (onChange) {
            onChange(v);
        }
        if (onOk) {
            onOk(v);
        }
    },
    render: function render() {
        return _react2["default"].createElement(_Popup2["default"], __assign({ picker: this.props.cascader }, this.props, { onOk: this.onOk }));
    }
});
exports["default"] = PopupCascader;
module.exports = exports['default'];